
$MajorLine = "=============================================================================================="
$MinorLine = "----------------------------------------------------------------------------------------------"
$AllAnswer = $null

$All = ($TargetServer -eq "all" -and $TargetApp -eq "all")

$PerformStop = $StopServicesOnly -and !($StartServices)
$PerformStart = $StartServicesOnly -and !($StopServices)
$PerformDeploy = -not( $StopServicesOnly -or $StartServicesOnly )
if (!($PerformStop))
{
 if ($All -and $PerformDeploy){$PerformStop = $All}
 if ($TargetServer -ne "all" -or $TargetApp -ne "all" -and $PerformDeploy){$PerformStop = $true}
} 

if (!($PerformStart))
{
 if ($All -and $PerformDeploy){$PerformStart = $All}
 if ($TargetServer -ne "all" -or $TargetApp -ne "all"  -and $PerformDeploy){$PerformStart = $true}
} 

#################################################################################
$deploymentName = get-location
if ($Verbose)
{
Log-Message @"
$MajorLine
Deploying $deploymentName 
$MajorLine
Selected Options 
$MinorLine
TargetEnv         $TargetEnv
TargetServer      $TargetServer
TargetApp         $TargetApp
help              $help
all               $all
StopServicesOnly  $StopServicesOnly
StartServicesOnly $StartServicesOnly
Verbose           $Verbose
Confirm           $Confirm
Whatif            $Whatif
ErrorAction       $erroractionpreference
$MinorLine
"@
}
else
{
Log-Message @"
PBND PowerShell Deployment                            
Deployment of $deploymentName to $($TargetEnv.ToUpper()) Environment                                                                  
"@
}
#################################################################################

